from django.db import models

# Create your models here.

#建立数据库类
class User(models.Model):
    # 主键
    id = models.AutoField(primary_key=True)
    # 用户名
    username = models.CharField(max_length=200)
    #密码
    password = models.CharField(max_length=255)
    #头像
    img = models.ImageField(upload_to='static/upload')
    #类别 0代表学生 1代表老师
    type = models.IntegerField()

    # 声明表名
    class Meta:
        db_table = 'user'


class Login(models.Model):
    id = models.AutoField(primary_key=True)
    username = models.CharField(max_length=200)
    password = models.CharField(max_length=200)
    img = models.ImageField(upload_to='static/upload')

    class Meta:
        db_table = 'login'


class Regi(models.Model):
    id = models.AutoField(primary_key=True)
    username = models.CharField(max_length=100)





